<template>
	<!-- 新品列表 -->
	<view class="case_list">
		<view class="case_item" v-for="(item,index) in newCase">
			<text>{{ item.product }}</text>
			<img :src="item.logo" :alt="item.title" />
			<button @click="toCheck(item.id)">立即查看</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				newCase:[]
			}
		},
		async onLoad() {
			// 查询新品列表
			let brandRes = await this.$api.getNewList();
			if(!brandRes?.success) return;
			this.newCase = brandRes.result.records;
		},
		methods: {
			// 跳转
			toCheck(id){
				uni.navigateTo({
					url: '/pages/car/caseDetail?id='+id+'&isNew='+true//新品跳转详情需要加isNew=true
				})
			}
		}
	}
</script>
<style>
	page{
		background-color: #F5F5F5;
	}
</style>
<style scoped lang="scss">
.case_list{
	padding-top: 19rpx;
	padding-bottom: 16rpx;
	display: flex;
	flex-direction: column;
	align-items: center;
	.case_item{
		width: 686rpx;
		height: 672rpx;
		background-color: #FFFFFF;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-top: 26rpx;
		text{
			margin: 32rpx 0rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: bold;
			font-size: 28rpx;
			color: rgba(0,0,0,0.8);
		}
		img{
			width: 590rpx;
			height: 444rpx;
			border-radius: 8rpx 8rpx 8rpx 8rpx;
			margin-bottom: 28rpx;
		}
		button{
			background: #000000;
			border-radius: 548rpx 548rpx 548rpx 548rpx;
			font-family: PingFang SC, PingFang SC;
			font-weight: 400;
			font-size: 28rpx;
			color: #FFFFFF;
			width: 190rpx;
			height: 72rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			&::after{
				display: none;
			}
			&:active{
				background-color: #292929;
				color: #cecece;
			}
		}
	}
}
</style>
